package com.example.car.manager.ui.headfragment;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import com.example.car.R;
import com.example.car.manager.BaseFragment;
import com.example.car.ui.dialog.KeBiaoDialog;
import com.example.car.ui.dialog.TaskDialog;
import com.example.car.ui.dialog.WeatherDialog;
import com.example.car.ui.dialog.WebDialog;
@SuppressLint("HandlerLeak")
public class HeadFragment extends BaseFragment implements OnClickListener{
	Context context;
	public HeadFragment(Context context) {
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view =inflater.inflate(R.layout.fragment_head,container,false);
		intiView(view);
		return view;
	}
	
	public void intiView(View view){
		view.findViewById(R.id.frag_head_kebiao).setOnClickListener(this);
		
		view.findViewById(R.id.frag_head_task).setOnClickListener(this);
		view.findViewById(R.id.head_captrue).setOnClickListener(this);
		view.findViewById(R.id.mywit).setOnClickListener(this);
		view.findViewById(R.id.frag_head_weizhang).setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.frag_head_kebiao:
			KeBiaoDialog dialog=new KeBiaoDialog(hodler);
			dialog.show();
			break;
		case R.id.frag_head_task:
			TaskDialog task=new TaskDialog(hodler);
			task.show();
			break;
		case R.id.head_captrue:
			WebDialog captrue=new WebDialog(hodler, "http://www.witpt.edu.cn");
			captrue.show();
			break;
		case R.id.mywit:
			WebDialog wit=new WebDialog(hodler, "http://www.51wits.com");
			wit.show();
			break;
		case R.id.frag_head_weizhang:
			WeatherDialog weather=new WeatherDialog(hodler);
			weather.show();
			break;
			

		default:
			break;
		}
	}
}
